package org.shoukaiseki.randomtools.utils;

import org.apache.commons.lang3.RandomUtils;


/**
 * 取随机数工具包
 * org.shoukaiseki.randomtools.utils.RandomInteger <br>
 *
 * @author 蒋カイセキ    Japan-Tokyo  2018-08-20 21:42:34<br>
 * ブログ http://shoukaiseki.blog.163.com/<br>
 * E-メール jiang28555@Gmail.com<br>
 **/

public class RandomInteger {

    /**
     * @param startInclusive    随机数最小值
     * @param endExclusive      随机数最大值
     * @return
     */
    public static  int  randomInt(int startInclusive, int endExclusive){
        if(startInclusive<0||endExclusive<0){
            return  RandomUtils.nextInt(0, endExclusive - startInclusive)+startInclusive;
        }
        return RandomUtils.nextInt(startInclusive,endExclusive);
    }

}
